#include <sys_config.h>
#include <sys_parameters.h>
#include <api/libc/printf.h>
#include <api/libc/string.h>

#define	OSD_INVALID_REGION		0xFF

typedef struct OSDRect  OSD_RECT, *POSD_RECT;

#define OSD_SetRect(r, _l, _t, _w, _h) \
    do{ \
        ((POSD_RECT)(r))->uLeft = (UINT16)(_l); \
        ((POSD_RECT)(r))->uTop = (UINT16)(_t); \
        ((POSD_RECT)(r))->uWidth = (UINT16)(_w); \
        ((POSD_RECT)(r))->uHeight = (UINT16)(_h); \
    }while(0)

#define OSD_CopyRect(dest, src) \
    do{ \
        ((UINT32 *)(dest))[0] = ((UINT32 *)(src))[0]; \
        ((UINT32 *)(dest))[1] = ((UINT32 *)(src))[1]; \
    }while(0)
#define OSD_SetRect2    OSD_CopyRect

struct osd_device* lib_subt_atsc_get_osd_handle(void);
RET_CODE lib_subt_atsc_clear_osd(struct osd_device *subt_atsc_osd_dev);
void lib_subt_atsc_display(struct OSDRect *rect,ATSC_subt_bmp_header *bmp_header,UINT16 color);
BOOL lib_subt_atsc_get_osd_rect(DISPLAY_STANDARD_TYPE type, struct OSDRect *rect);
RET_CODE lib_subt_atsc_osd_set_pallette(struct osd_device *subt_atsc_osd_dev,ATSC_subt_bmp_header *bmp_header);
void lib_subt_atsc_osd_set_present(BOOL present);
void lib_subt_atsc_show_screen();
RET_CODE lib_subt_atsc_get_region_pos(struct osd_device *subt_atsc_osd_dev);


